<template>
	<view class="content">
		<my-swiper></my-swiper>
		<nav-cards></nav-cards>
		<u--image src="https://health-wanglijie.oss-cn-hangzhou.aliyuncs.com/uni_img/asset-ad.png"
		 mode="widthFix" style="border-radius: 20rpx;padding-left: 60rpx;"></u--image>
	</view>
</template>

<script>
import navCards from '../navCards/navCards.vue'	
import mySwiper from '../mySwiper/mySwiper.vue'
	export default {
		components:{navCards,mySwiper},
		data() {
			return {
				title: 'Hello',
				userInfo:'',
				user:{}
			}
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title: '首页'
			});
			this.userInfo = uni.getStorageSync("userInfo")
			console.log(this.userInfo)
			this.user = JSON.parse(this.userInfo)
			if(this.userInfo === "" || this.userInfo === null){
				uni.redirectTo({
					url:"/pages/myLogin/myLogin"
				})
			}else{
				uni.request({
					url:"/api/member/getLoginStatus.do",
					header:{
						"content-type":"application/json"
					},
					data:{
						client_member:this.user
					},
					method:"POST",
					success: (res) => {
						console.log(res.data)
						if(!res.data.flag){
							uni.redirectTo({
								url:"/pages/myLogin/myLogin"
							})
						}else{
							uni.setStorageSync("userInfo",res.data.data)
							this.user = JSON.parse(res.data.data)
							return
						}
					}
				})
				
			}
		},
		methods: {

		}
	}
</script>

<style>
	.content{

	}
	
</style>
